<template>
  <div>
    <h2 v-color="fontColor">信息列表</h2>
    <Mytable :list="list">
      <template #portrait="scope">
        <img :src="scope.imgSrc" alt="">
      </template>
    </Mytable>
  </div>
</template>

<script>
import Mytable from "@/components/Mytable"
export default {
data(){
  return{
    list: [
        {
            name: "小传同学",
            age: 18,
            headImgUrl:
            "http://yun.itheima.com/Upload/./Images/20210303/603f2d2153241.jpg",
        },
        {
            name: "小黑同学",
            age: 25,
            headImgUrl:
            "http://yun.itheima.com/Upload/./Images/20210304/6040b101a18ef.jpg",
        },
        {
            name: "智慧同学",
            age: 21,
            headImgUrl:
            "http://yun.itheima.com/Upload/./Images/20210302/603e0142e535f.jpg",
        },
    ],
    fontColor:"skyblue"
  }
},
created(){
  setInterval(() => {
  let r=Math.round(Math.random()*255)
  let g=Math.round(Math.random()*255)
  let b=Math.round(Math.random()*255)
  this.fontColor=`rgb(${r},${g},${b})`
  }, 1500);
  
},
components:{
  Mytable
}
}
</script>

<style>

</style>